Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NetP subscription integration #1710

Merged
merged 31 commits into from
Dec 25, 2023

Conversation

samsymons
Copy link
Collaborator

@samsymons samsymons commented Oct 4, 2023

Task/Issue URL: https://app.asana.com/0/0/1205645389501251/f
Tech Design URL:
CC:

Description:

This PR integrates NetP with the subscription library.

Steps to test this PR:

Unfortunately, this isn't really possible to test at the moment. Here's what the flow would normally look like though, in case you want to try:

  1. Sign into the sandbox account in the App Store app
  2. Launch the DuckDuckGo Privacy Pro target on this branch
  3. Go to Debug -> Subscription -> Purchase Subscription from App Store
  4. Pick a subscription option (I recommend weekly, since it will expire sooner)
  5. Click through the next few prompts to confirm
  6. Open the browser's settings screen and select Privacy Pro, check that you are signed in
  7. At this point, the app would normally be expected to have fetched your access token and exchanged it for a NetP access token - but there's a race condition where the token is returned too early, and the NetP service may not yet be able to redeem it. You can check this by trying to open the Network Protection menu item and checking if the NetP UI appears. If not, see below.

⚠️ If the issue above occurs, sign out of your Privacy Pro account and then sign back in with the "Restore Purchases" option. Then try to open NetP again and validate that the popover appears. A PR to resolve that race condition will be available when we work on the "recheck entitlements" project.


Internal references:

Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation

# By Alexey Martemyanov (4) and others
# Via GitHub
* develop:
  Fix an issue with NetP debug menu options (#1717)
  Update BSK for iOS Autofill on by default changes (#1699)
  Removes iOS phased rollout dry run pixel (#1706)
  NetP connection notifications improvements (#1730)
  Fix PixelExperiment tests (#1708)
  Add Safari Technology Preview data import source (#1720)
  remove failedToImport state (#1722)
  DBP: Add pixel to measure parent/child broker relationship (#1709)
  fix crash on Reset Bookmarks (#1719)
  Upload .xcresult artifacts on PR test failure (#1715)
  Support to deprecated flag on ProfileQuery (#1698)
  Bump BSK to latest version (#1716)
  Surgical update to fb-sdk.js (#1711)

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
@samsymons samsymons marked this pull request as ready for review October 8, 2023 22:47
@samsymons samsymons requested a review from graeme October 8, 2023 23:09
Copy link
Collaborator

@graeme graeme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just a couple of minor non-blocking comments.

# By Dominik Kapusta (28) and others
# Via Dominik Kapusta (12) and others
* develop: (185 commits)
  bump bsk for cbr user script energy optimisation  (#1888)
  Add folders from the Bookmark Creation Popover (#1861)
  DBP: Prepare database for external users (#1880)
  Address Bar Spoofing Remediations + Test Cases (#1815)
  1.65.1 (83)
  Update BSK ref
  Set version to 1.64.3 (82)
  Update embedded files
  Fix migration to form-factor-specific favorites (#1884)
  Revert "Breakage report improvements" (#1885)
  Breakage report improvements (#1864)
  Assign no action to menu item if it represents a bookmark folder (#1881)
  dbp: updating CSS for access to DBP JS (#1879)
  Fix tests (#1882)
  Remove DBP target and merge DBP to DevID target (#1876)
  Bump autoconsent to 6.4.0 (#1869)
  Fixes a bug where an observer was not being released (#1878)
  DBP: Delete old native UI code (#1877)
  DBP: Fix deleting all data breaking a foreign constraint (#1871)
  Queue access to XPCConnectionsManager's connections for thread safety (#1875)
  ...

# Conflicts:
#	Configuration/App/DuckDuckGoPrivacyPro.xcconfig
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
#	DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/EventMapping+NetworkProtectionError.swift
#	DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/MacPacketTunnelProvider.swift
#	LocalPackages/BuildToolPlugins/Plugins/InputFilesChecker/InputFilesChecker.swift
@samsymons samsymons self-assigned this Nov 27, 2023
@ayoy ayoy changed the base branch from develop to main December 6, 2023 16:05
# By Dominik Kapusta (41) and others
# Via Dominik Kapusta (9) and others
* main: (138 commits)
  Make sure when we set custom config url, we don't expect etag in return (#1994)
  Add PixelKit source parameter (#1989)
  Fix internal user toggling (#2000)
  Show alert and display warning icon in Sync Settings when data syncing is disabled (#1996)
  DBP: Integrate subscription account authentication to DBP (#1995)
  Improve bookmarks html reader (#1986)
  Add Sync feature flags (#1992)
  Add daily stats pixel (#1993)
  Do not reload DBP tab when switching to it (#1942)
  Fix: external application requests via redirect URLs shows wrong origin. (#1900)
  Update clean-app.sh to work on macOS Sonoma and include NetP containers (#1988)
  Fix: "SwiftLintPlugin" must be enabled before it can be used (#1987)
  Prevent VPN server list persistence failures (#1985)
  add test can remove data (#1980)
  Remove VPN upgrade card (#1983)
  Fix low-res VPN warning asset (#1984)
  DBP: Fix unreliable date tests (#1981)
  Add search retention pixel for NetP (#1964)
  Sabrina/sync e2e tests (#1959)
  swiftlint build plugin (#1318)
  ...

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
#	DuckDuckGo/Application/AppDelegate.swift
# By Diego Rey Mendez (4) and others
# Via Fernando Bunn (2) and GitHub (1)
* main:
  Adds option + click support for our VPN menu to show some useful debu… (#2007)
  Update latency & tunnel failure monitor implementation (#2005)
  Prevents VPNSettings from reporting fake changes (#2004)
  Updates the copy for the VPN status bar item context menu (#2003)
  Implement subscription purchase (#1906)
  DBP: Add m_mac prefix to Pixels (#1952)
  Bump version to 1.69.0 (96)
  Update embedded files
  Update Link Tracking Protection to preserve headers (#1965)
  VPN menus improvements (#1979)
  Data Import ux redo (#1754)
  Fix: "SwiftLintPlugin" must be enabled before it can be used (#1987)

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
#	DuckDuckGo/NavigationBar/View/NavigationBarViewController.swift
samsymons added a commit to duckduckgo/BrowserServicesKit that referenced this pull request Dec 25, 2023
Required:

Task/Issue URL: https://app.asana.com/0/0/1205645389501250/f
iOS PR: duckduckgo/iOS#2077
macOS PR: duckduckgo/macos-browser#1710
What kind of version bump will this require?: Major

Description:

This PR adds support for exchanging access tokens for auth tokens.
@samsymons samsymons merged commit c9b0316 into main Dec 25, 2023
14 checks passed
@samsymons samsymons deleted the sam/add-netp-subscription-auth-support branch December 25, 2023 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants